import type { ColumnProps } from '../../functionalComponent';

// 操作弹窗配置
export const opFormConfig = [
  {
    name: 'bizCode',
    label: '业务编码',
    xtype: 'Input',
    colspan: 1
  },
  {
    name: 'name',
    label: '业务表单',
    xtype: 'Input',
    colspan: 1
  },
  {
    name: 'feignName',
    label: '微服务名称',
    xtype: 'Input',
    colspan: 1
  },
  {
    name: 'url',
    label: '方法url',
    xtype: 'Input',
    colspan: 1
  }
];

// 操作弹窗容器配置
export const opFormColumns: ColumnProps[] = [
  {
    dataIndex: 'tableName',
    header: '表英文名',
    width: 120,
    flex: 1,
    sortable: false,
    resizable: false,
    columnSort: false
    // editor: {
    //   xtype: 'Input',
    //   required: true
    // }
  },
  {
    dataIndex: 'filedName',
    header: '字段英文名',
    width: 120,
    flex: 1,
    sortable: false,
    resizable: false,
    columnSort: false
    // editor: {
    //   xtype: 'Input',
    //   required: true
    // }
  },
  {
    dataIndex: 'filedDepiction',
    header: '字段中文名',
    width: 120,
    flex: 1,
    sortable: false,
    resizable: false,
    columnSort: false
    // editor: {
    //   xtype: 'Input',
    //   required: true
    // }
  },
  {
    dataIndex: 'mustInput',
    header: '导出',
    width: 60,
    flex: 1,
    sortable: false,
    resizable: false,
    columnSort: false,
    align: 'center',
    format: { type: 'option' },
    editor: {
      xtype: 'checkbox',
      antProps: {
        checkedValue: 1,
        unCheckedValue: 0,
        onClick: (e) => e.stopPropagation()
      },
      disabled({ row }) {
        return row.init === 1;
      }
    }
  }
];
